/*
 * @File    :   mkdir.js
 * @Time    :   2024/03/22 13:42:18
 * @Author  :   chakcy
 * @Email   :   947105045@qq.com
 * @description   :   创建文件夹
 */

const fs = require('fs');
const path = require('path');

// 创建文件夹
function mkdirSync(dirPath) {
    // 检查文件夹是否存在  
    if (!fs.existsSync(dirPath)) {
        // 如果不存在，则创建文件夹  
        fs.mkdirSync(dirPath, { recursive: true })
        console.log(`Directory ${dirPath} has been created!`)
    } else {
        console.log(`Directory ${dirPath} already exists.`)
    }
}

module.exports = {
    mkdirSync
}